package entity

import (
	"shqsoft.cn/pasnj/base"

	"github.com/jinzhu/gorm"
)

//INDI_BGX 零售保管箱导入
type INDI_BGX struct {
	ID    int     `gorm:"AUTO_INCREMENT;primary_key;column:ID"`
	DRRQ  string  `gorm:"column:DRRQ"`
	RZRQ  string  `gorm:"column:RZRQ"`
	JYDW  string  `gorm:"column:JYDW"`
	KHMC  string  `gorm:"column:KHMC"`
	ZJHM  string  `gorm:"column:ZJHM"`
	C2988 string  `gorm:"column:C2988"`
	D4188 string  `gorm:"column:D4188"`
	E6388 string  `gorm:"column:E6388"`
	ZQ    string  `gorm:"column:ZQ"`
	ZJ    float64 `gorm:"column:ZJ"`
	ZS    float64 `gorm:"column:ZS"`
	ZLXS  string  `gorm:"column:ZLXS"`
	DRJG  string  `gorm:"column:DRJG;"`
}

//INDI_BGXAfterImport 导入后执行
func INDI_BGXAfterImport(tx *gorm.DB, params map[string]string) (err error) {
	prams := make([]interface{}, 1)
	prams[0] = params["DRRQ"]
	err = tx.Exec("EXEC UP_INDI_BGX_DTIP ?", prams[0]).Error
	if err != nil {
		return err
	}
	return nil
}

//TableName 国际中收导入表
func (INDI_BGX) TableName() string {
	return "T_INDI_BGX"
}

//INDI_BGXEF 返回结构体
func INDI_BGXEF() base.EntityFunc {
	return func() interface{} {
		entity := INDI_BGX{}
		return &entity
	}
}

//INDI_BGXESF 返回结构体数组
func INDI_BGXESF() base.EntitiesFunc {
	return func() interface{} {
		var entities []INDI_BGX
		return &entities
	}
}

func init() {
	base.DaoPoolObj.Put("INDI_BGX", base.NewDefaultDao(INDI_BGXEF(), INDI_BGXESF(), nil))
	base.SetAfterCallBack("INDI_BGX", INDI_BGXAfterImport)

}
